- SOLUTION -
Build large strings in chunks,
instead of all at once.
myVar = "~~~"
myVar += "~~~"
myVar += "~~~"

I don't know the maximum size limit for string chunks.


- CAUSE OF PROBLEM -
This error occurs when you try to define a GIGANTIC string
all at once.
